import request from "@/request/api";


//获取组织详情
export function getGroup(id) {
    return request({
        url: "/eam-service-tool/toolAccounts/getGroup",
        method: "get",
        params: id,
    });
}
//获取当前组织所属单位
export function getDept(id) {
    return request({
        url: "/eam-service-tool/toolAccounts/getDept",
        method: "get",
        params: id,
    });
}

//获取所有场站级组织
export function getAllStationGroup() {
    return request({
        url: "/eam-service-tool/toolAccounts/getAllStationGroup",
        method: "get",
        params:'',
    });
}
///toolAccounts/getGroupOrder
// 获取组织当前排序

export function getGroupOrder(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/getGroupOrder",
        method: "get",
        params: data,
    });
}
// 查询当前组织下的库房或下属数据
export function getChildGroup(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/getChildGroup",
        method: "get",
        params: data,
    });
}
//查询当前组织下的库房及下属收据
export function getChildTree(id) {
    return request({
        url: "/eam-service-tool/toolAccounts/getChildTree",
        method: "get",
        params: id,
    });
}
//查询当前组织下的组织或工器具
export function getList(id) {
    return request({
        url: "/eam-service-tool/toolAccounts/getList",
        method: "get",
        params: id,
    });
}
//获取工器具详情数据
export function getTool(id) {
    return request({
        url: "/eam-service-tool/toolAccounts/getTool",
        method: "get",
        params: id,
    });
}
// 获取当前组织所属库房
export function getWarehose(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/getWarehose",
        method: "get",
        params: data,
    });
}
// 新增实体时获得序号
export function getToolOrder(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/getToolOrder",
        method: "get",
        params: data,
    });
}
// 手动报废工器具
export function scrapTool(id) {
    return request({
        url: "/eam-service-tool/toolAccounts/scrapTool",
        method: "get",
        params: id,
    });
}
//新增组织（虚拟）
export function addGroup(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/addGroup",
        method: "post",
        data: data,
    });
}
//删除组织（虚拟）
export function deleteGroup(id) {
    return request({
        url: "/eam-service-tool/toolAccounts/deleteGroup",
        method: "delete",
        params: id,
    });
}
//新增工器具（实体）
export function addTool(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/addTool",
        method: "post",
        data: data,
    });
}
//删除工器具（实体）
export function deleteTool(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/deleteTool",
        method: "delete",
        params: data,
    });
}
//编辑组织
export function updateGroup(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/updateGroup",
        method: "post",
        data: data,
    });
}
//修改工器具
export function updateTool(data) {
    return request({
        url: "/eam-service-tool/toolAccounts/updateTool",
        method: "post",
        data: data,
    });
}
//获取数字字典
export function getDict(data) {
    return request({
        url: "/eam-service-tool/dict/getDict",
        method: "get",
        params: data,
    });
}
